#pragma once
#include <grpcpp/grpcpp.h>
#include "../event_loop/event.h"
#include "DataExchange.grpc.pb.h"
#include "DataExchange.pb.h"	
using grpc::ClientAsyncResponseReader;
using grpc::ClientContext;
using grpc::CompletionQueue;
using grpc::Status;
using grpc::Channel;

template<typename TYPE>
	class CallData {
		
	public:
		CallData(DataExchange::TableName n, std::unique_ptr<Event> et):tablename(n),event(std::move(et)){
			selfptr = this;
		};
		CallData<TYPE>* selfptr;
		DataExchange::TableName tablename;
		ClientContext context;
		Status status;
		std::unique_ptr<Event> event;
			std::unique_ptr<ClientAsyncResponseReader<TYPE>> response_reader;
			TYPE reply;
			std::function<std::any(void)>geter;

	};